".$fSettings["ForumName"].""; $CurrentLocation.= " : ".$BoardName.""; $CurrentLocation.= " : ".SensorWord($TopicName); if ($TopicStatus == 1) $CurrentLocation .= " \"This"; $MessageOptions = "";//""; // $MessageOptions.= "\"Neues"; // $MessageOptions.= " "; // $MessageOptions.= "\"Neue"; // if ($TopicStatus == 0 || $CurrentUserIsMod==1) // { $MessageOptions.= " "."\"Antworten"; // } if ($TopicInfo["IsPoll"]) $ent["PollResults"] = GrabPollBox($TopicID); $ent["fTitleBGColor"] = $fSettings["title_backcolor"]; $ent["fTitleTColor"] = $fSettings["title_textcolor"]; $ent["fCatBGColor"] = $fSettings["cat_backcolor"]; $ent["fCatTColor"] = $fSettings["cat_textcolor"]; $ent["fMsgBGColor1"] = $fSettings["msg_backcolor"]; $ent["fMsgBGColor2"] = $fSettings["msg_backcolor2"]; $ent["fBorderColor"] = $fSettings["bordercolor"]; $ent["AnnouncementMSG"] = GrabAnnouncement($BoardID); $ent["NavPath"] = $CurrentLocation; $ent["NewandReply"] = $MessageOptions; $ent["PageSpan"] = $pages; $ent["Print"] = "Dieses Thema drucken Thema drucken"; $ent["LoginBox"] = GrabLoginBox("$fSettings[ScriptURL]/viewtopic.php?TopicID=$TopicID&page=$page"); if ($CurrentUserIsMod == 1) { $ent["ModFunctions"] = "Moderator Functions: "; $ent["ModFunctions"].= "$txt[LockTopic] | "; $ent["ModFunctions"].= "$txt[MoveTopic] | "; $ent["ModFunctions"].= "$txt[MergeTopic] | "; $ent["ModFunctions"].= "$txt[TopTopic]"; } $template = ReadTemplate("viewtopic"); $pos_start = strpos($template,"")+strlen(""); $pos_end = strpos($template,"",$pos_start); $first_part = substr($template,0,$pos_start-strlen("")); $last_part = substr($template,$pos_end,strlen($template)-$pos_end); print ParseTemp($first_part,$ent); $first_loop = substr($template,$pos_start,$pos_end-$pos_start); $tIcons = GetPostIcons(); $table = ""; $limit = $page*$messagesperpage; $query = "SELECT * FROM t_messages WHERE TopicID = $TopicID AND BoardID = $BoardID Order By DatePosted ASC LIMIT $limit,$messagesperpage"; $result = mysql_query($query); if ($row = mysql_fetch_array($result)) { $i=0; do { $msgInfo = $row; $unset_array = array("UserLevelIcon","Avatar","PosterRegDate","PosterNumPost","PosterIP", "visithomepage", "icq","userprofile","pmuser","emailuser","searchuserposts","MsgOptions"); //while (list(,$key) = each($unset_array)) foreach ($unset_array as $key=>$val) // php 8.0 { unset($ent[$key]); } if ($i%2) $ent["fMsgBGColorAlt"] = $fSettings["msg_backcolor2"]; else $ent["fMsgBGColorAlt"] = $fSettings["msg_backcolor"]; $UserInfo = GrabUserInfo($msgInfo["Poster"]); $msgIcon = $tIcons[$msgInfo["PostIcon"]]; $ent["UserName"] = "".htmlspecialchars($UserInfo['UserName'])."
"; $ent["UserLevel"] = "$txt[UserLevel]: $UserInfo[UserLevel]
"; if ($UserInfo["Icon"]) { $ent["UserLevelIcon"] = "
";} if ($UserInfo["Avatar"] && substr($UserInfo["Avatar"],0,7)=="http://") { $ent["Avatar"] = "
";} if ($UserInfo["RegDate"]) { $ent["PosterRegDate"] = "$txt[Registered]: ".FormatDate($UserInfo['RegDate'],$CurrentUserInfo['timezone'])."
";} if ($UserInfo["NumPost"]) { $ent["PosterNumPost"] = "$txt[Posts]: $UserInfo[NumPost]
";} $ent["PosterIP"] = "IP: "; if ($CurrentUserIsMod) { $ent["PosterIP"] .= $msgInfo["PosterIP"]; } else { $ent["PosterIP"] .= "Logged"; } if ($UserInfo["LevelID"] != 99) { $ent["userprofile"] = "\"View"; $ent["pmuser"] = "\"Send"; $ent["emailuser"] = "\"Send"; $ent["searchuserposts"] = "\"".$txt["ShowPosts"]."\""; } if ($UserInfo["Homepage"]) { $ent["visithomepage"] = "\"Visit"; } if ($UserInfo["ICQNumber"]) { $ent["icq"] = "";} $ent["MsgID"] = $msgInfo["ID"]; $ent["MsgIcon"] = "icon"; $ent["Subject"] = SensorWord(stripslashes($msgInfo["Subject"])); $ent["DatePosted"] = FormatDate($msgInfo["DatePosted"],$CurrentUserInfo['timezone']); $ent["TimePosted"] = FormatTime($msgInfo["DatePosted"],$CurrentUserInfo['timezone']); if (($CurrentUserInfo["UserName"] == $UserInfo["UserName"]) || $CurrentUserIsMod) $ent["MsgOptions"] = "$txt[Edit] | "; if ($msgInfo["Locked"] == 0) $ent["MsgOptions"] .= "$txt[QuoteReply]"; if (($UserInfo["Signature"]) && ($msgInfo["AddSig"])) { $ent["Message"] = ParseMSG($msgInfo["Message"]."\n\n____________________________\n".$UserInfo["Signature"],$msgInfo["Emoticon"]);} else { $ent["Message"] = ParseMSG($msgInfo["Message"],$msgInfo["Emoticon"]);} print ParseTemp($first_loop,$ent); $i++; } while ($row = mysql_fetch_array($result)); } // Below is the nightmare that is the surf_to drop down box creation sequence via templates. $surftobox = ReadTemplate("surfto"); $cat_start = strpos($surftobox,"")+strlen(""); $cat_end = strpos($surftobox,""); $board_begin = strpos($surftobox,"")+strlen(""); $board_end = strpos($surftobox,""); $cat_loop = substr($surftobox,$cat_start,$cat_end-$cat_start); $board_loop = substr($surftobox,$board_begin,$board_end-$board_begin); $first_bit = substr($surftobox,0,$cat_start-strlen("")); $last_bit = substr($surftobox,$board_end+strlen(""),strlen($surftobox)-$board_end); $ent["ScriptURL"] = $fSettings["ScriptURL"]; $ent["SurfTo"] = ParseTemp($first_bit,$ent); $query = "SELECT ID, CatName FROM t_categories Order By cOrder ASC"; $result = mysql_query($query); if ($row = mysql_fetch_row($result)) { do { $query="SELECT ID FROM t_boards WHERE CatID = '".$row[0]."'"; $result2 = mysql_query($query); if (mysql_num_rows($result2) < 1) continue; $ent["CatID"] = $row[0]; $ent["CatName"] = $row[1]; $ent["SurfTo"].= ParseTemp($cat_loop,$ent); $query = "SELECT ID, bName FROM t_boards WHERE CatID = ".$row[0]." ORDER BY bOrder ASC"; $result2 = mysql_query($query); if ($row2 = mysql_fetch_row($result2)) { do { $ent["BoardID"] = $row2[0]; $ent["bName"] = $row2[1]; if ($BoardID == $row2[0]) { $ent["IS_SELECTED"] = "SELECTED "; } else { $ent["IS_SELECTED"] = ""; } $ent["SurfTo"].=ParseTemp($board_loop,$ent); } while ($row2 = mysql_fetch_array($result2)); } } while ($row = mysql_fetch_row($result)); } else { $ent["SurfTo"].= ""; } $ent["SurfTo"].= ParseTemp($last_bit,$ent); print ParseTemp($last_part,$ent); PrintForumRules($BoardID); fFooter(); ?>